<?php
$order_list = select_lines_all_items($table_Prefix."order_list" ,'nid desc ',' status = 0 ');


$caiwu_quanxian = 0;
$cangguan_quanxian = 0;
if(in_array( '订单管理_财务订单列表',$quanxian)){
    $caiwu_quanxian = 1;
}
if(in_array( '订单管理_财务订单列表',$quanxian)){
    $cangguan_quanxian = 1;
}

if($caiwu_quanxian == 1 || $cangguan_quanxian == 1){
?>
<fieldset class="layui-elem-field layui-field-title" >
    <legend>待发货订单</legend>
</fieldset>

<div class="list-boxes">

    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="">

            <col >
            <col >
            <col width="">
            <col >
            <col >

        </colgroup>
        <thead>
        <tr>

            <th>序号</th>
            <th>发往国家</th>
            <th>订单号</th>
            <th>柜号</th>
            <th>发货状态</th>
            <th>下单时间</th>

            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <?php

        if (!$order_list) {
            echo "<tr><td colspan='7'>暂无数据</td></tr>";
        }

        ?>


        <?php
        foreach($order_list as $order_key=>$order){
            $country = select_one_line_all_items($table_Prefix.'freight','nid='.$order['country']);
            $order['country'] = $country;


            $order_key++;
            ?>

            <?php
            if($caiwu_quanxian == 1){
            ?>
            <tr >
                <td><?echo $order_key  ?></td>
                <!--      <td><input type="checkbox" value="--><?//echo $order['nid']?><!--" name="nid[]" class="" ></td>-->
                <td><a class="green"  href="../../order/view/detail-list.php?country=<?php echo $order['country']['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><? echo $order['country']['name']?></a></td>
                <td><a class="blue"  href="../../order/view/order_user.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><? echo $order['order_sn']?></a> </td>
                <td><? echo $order['container_number']?></td>
                <td><? echo $order['status'] == 1 ? '已发货':'待发货';?></td>
                <td><? echo $order['add_date']?></td>
                <td>
                    <a href="../../order/view/detail-edit.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"
                       class=" layui-btn  layui-btn-sm" >
                        <i class="fa fa-eye" aria-hidden="true"></i>详情</a>

                   <!-- <a href="../../order/view/order_user.php?nid=<?php /*echo $order['nid']*/?>&sys_part=<?/*echo $_REQUEST['sys_part']*/?>"
                       class=" layui-btn  layui-btn-sm" >
                        <i class="fa fa-eye" aria-hidden="true"></i>用户详情</a>-->


                    <?php
                    if($order['status'] == 0){
                        ?>
                        <a class="layui-btn  layui-btn-sm" href="../../order/view/delete.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><i class="layui-icon">&#xe640;</i>删除</a>
                        <?php
                    }
                    ?>
                    <a href="../../order/view/detail-wl.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"
                       class=" layui-btn  layui-btn-sm" >
                        <i class="fa fa-eye" aria-hidden="true"></i>物流编辑</a>

                </td>
            </tr>
            <?php
            }
            elseif($cangguan_quanxian == 1){
            ?>
                <tr >
                    <td><?echo $order_key + 1 ?></td>
                    <td><a class="green"  href="../../detail-warehouse-list.php?country=<?php echo $order['country']['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><? echo $order['country']['name']?></a></td>
                    <td><a class="blue"  href="../../warehouse-order-user.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><? echo $order['order_sn']?></a> </td>
                    <td><? echo $order['container_number']?></td>
                    <td><? echo $order['status'] == 1 ? '已发货':'待发货';?></td>
                    <td><? echo $order['add_date']?></td>
                    <td>
                        <a href="../../detail-warehouse-edit.php?nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"
                           class=" layui-btn  layui-btn-sm" >
                            <i class="fa fa-eye" aria-hidden="true"></i>详情</a>

                        <?php
                        if($order['status'] == 0){
                        ?>
                            <a class="layui-btn  layui-btn-sm" href="../../delete.php?type=warehouse&nid=<?php echo $order['nid']?>&sys_part=<?echo $_REQUEST['sys_part']?>"><i class="layui-icon">&#xe640;</i>删除</a>
                        <?php
                        }
                        ?>
                       </td>
                </tr>
            <?php
            }
            ?>
            <?php

        }
        ?>
        </tbody>
    </table>

</div>
<?php } ?>